/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package l1j.server.server.serverpackets;

import l1j.server.Config;

public class S_ServerVersion extends ServerBasePacket {
	private static final String S_SERVER_VERSION = "[S] ServerVersion";

	private static final int CLIENT_LANGUAGE = Config.CLIENT_LANGUAGE;

	/** 系統時間驗證 */
	private static final int UPTIME = 1327204035;// (int)
													// (System.currentTimeMillis()
													// / 1000);

	/** 服務器版本. */
	private static final int SERVER_VERSION = 120913203;

	/** 緩存版本. */
	private static final int CACHE_VERSION = 120913200;

	/** 認證(身份驗證)版本. */
	private static final int AUTH_VERSION = 2010083002;

	/** NPC版本. */
	private static final int NPC_VERSION = 120913201;

	public S_ServerVersion() {
		this.writeC(S_OPCODE_SERVERVERSION);
		this.writeC(0x00);
		this.writeC(0x00);
		this.writeD(SERVER_VERSION);// TODO 3.53Cserver version
		this.writeD(CACHE_VERSION);// TODO 3.53Ccache version
		this.writeD(AUTH_VERSION);// TODO 3.53Cauth version
		this.writeD(NPC_VERSION);// TODO 3.53npc version
		this.writeD(0x0);
		this.writeC(0x00);// TODO 未知封包
		this.writeC(0x00);// TODO 未知封包
		this.writeC(CLIENT_LANGUAGE);
		this.writeD(0x77d82);// TODO 未知封包
		this.writeD(UPTIME);
	}

	@Override
	public byte[] getContent() {
		return this.getBytes();
	}

	@Override
	public String getType() {
		return S_SERVER_VERSION;
	}
}
